<template>
  <div class>
    <el-drawer
      :visible.sync="isDrawer"
      :with-header="false"
      :size="size"
      :before-close="handleClose"
    >
      <el-container>
        <el-header>{{ title }}</el-header>
        <el-main>
          <slot></slot>
        </el-main>
        <el-footer>
          <slot name="footer"></slot>
        </el-footer>
      </el-container>
    </el-drawer>
  </div>
</template>

<script >
export default {

  props: {
    //显示与隐藏
    isDrawer: {
      type: Boolean,
      default: false
    },
    //标题
    title: {
      type: String,
    },
    //宽度
    size: {
      type: String,
    }
  },
  name: "",
  components: {},
  data () {
    return {
    }
  },
  methods: {
    //关闭弹出层
    handleClose () {
      this.$parent.closeDrawer()
    }
  },

}
</script>

<style lang="scss" scoped>
.el-header {
  padding-top: 15px;
  font-size: 20px;
  font-weight: 700;
}
.el-main {
  height: calc(100vh - 130px);
}
.el-footer {
  padding-top: 15px;
}
</style>
